import Tabs from '@/views/Tabs.vue';
import Home from '@/views/Home.vue';
import About from '@/views/About.vue';
import Contact from '@/views/Contact.vue';

const routes = [
    {
        path: '/tabs/',
        component: Tabs,
        tabs: [
            {
                path: '/',
                component: Home,
                id: 'home',
            },
            {
                path: '/about/',
                component: About,
                id: 'about',
            },
            {
                path: '/contact/',
                component: Contact,
                id: 'contact',
            }
        ]
    },
    {
        path: '/actionsheet/',
        async(routeTo, routeFrom, resolve) { // 路由懒加载方式
            const vueComponent = () => import('./../components/ActionSheet.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/badge/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('./../components/Badge.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/block/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('./../components/Block.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/card/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('./../components/Card.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/checkbox/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('./../components/Checkbox.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/dialog/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('./../components/Dialog.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/button/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('@/components/Button.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    },
    {
        path: '/panel/',
        async(routeTo, routeFrom, resolve) {
            const vueComponent = () => import('@/components/Panel.vue');
            vueComponent().then((vc) => {
                resolve({ component: vc.default })
            });
        },
    }
]
export default routes;
